package com.ak47.cms.cms.controller

import com.ak47.cms.cms.service.CrawMeiziImageService
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController

/**
 * Created by jack on 2017/7/22.
 */

@RestController
class CrawImageController {

    @Autowired
    lateinit var crawMeiziImageService: CrawMeiziImageService

    @GetMapping("doImageCrawJob")
    fun doHuaBanImageCrawJob(): String {
        GlobalScope.launch {
            crawMeiziImageService.doCraw()
        }
        return "doImageCrawJob Started"
    }

}
